<template>
	<div class="details">
		<div class="back">
			<el-button class="btn" type="primary" @click="goback">返回</el-button>
		</div>
		<div class="pageTickets"> 
			<el-table :data="pageTicket" style="width: 100%">
			    <el-table-column prop="userName" label="评论人"></el-table-column>
			    <el-table-column prop="wareName" label="商品信息"></el-table-column>
			    <el-table-column prop="opinionTime" label="评论时间"></el-table-column>
			    <el-table-column prop="ordersId" label="订单号"></el-table-column>
			</el-table> 
			<h3 class="content">
                评论内容
				<p>
					<span v-for="x in pageTicket" :key="x">{{ x.opinionContent }}</span>
					<span class="box">
						<img v-for="y in imgs" :key="y" :src="baseUrl+y"/>
					</span>
				</p>
			</h3>
		</div>
	</div>
</template>
<script>
	export default {
		data() {
			return {
                baseUrl:require("../assets/baseUrl.js").baseUrl,
				pageTicket:[],
				imgs:[]
			}
		},
		methods:{
			//返回上一级
			goback(){
				this.$router.go(-1)
			},
			//详情:oponion/xiang
			getCuntent(){
				if(sessionStorage.getItem("adminRole")==2){
					this.$http.post(this.baseUrl+'oponion/quanxiang',{
                    	opinionId:this.$route.query.opinionId
					}).then(res=>{
							// console.log(res.data.data);
						if(res.data.code==200){
							this.pageTicket=res.data.data.opinion
							this.imgs=res.data.data.opinionImgs
						}
					})
				}else{
					this.$http.post(this.baseUrl+'oponion/xiang',{
                    	opinionId:this.$route.query.opinionId
					}).then(res=>{
					/*   console.log(res.data.data); */
						if(res.data.code==200){
							this.pageTicket=res.data.data.opinion
							this.imgs=res.data.data.opinionImgs
						}
					})
				}
				
			}
		},
		mounted() {
            this.getCuntent()
		}
	}
</script>

<style lang="less">
    .details{
        width: 90%;
		margin: 0 auto;
		.pageTickets{
			margin-top: 3%;
			.el-table tr{
			background-color: #fcfcfc;
			color: #333;
			font-size: 15px;
			font-weight: bolder;
		}
		.el-table th.el-table__cell{
			background-color: #fcfcfc;
		}
		.el-table th.el-table__cell>.cell{
			color: #333;
			font-size: 19px;
		}
			
			.content{
				margin-top: 5%;
				p{
					width: 100%;
					
					border: 2px solid #a7a6a6;
					border-radius: 5px;
					margin-top: 10px;
					span{
						display: block;
						font-weight: normal;
						margin-top: 15px;
						margin-left: 10px;
					}
					.box{
						
						img{
							//width: 15%;
							height: 180px;
							margin-right: 5%;
						}
					}
				}
			}
		
			.el-table__empty-block{
			background-color: #fcfcfc;
		}
		.el-table *{
			border: none !important;
			text-align: center;
		}
		.el-table::before{
			height: 0px;
		}
		}
    }
	
</style>